<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>${ painting.title!''}_可观艺术</title>
<meta name="Keywords" content="${ painting.title!''},大师作品鉴赏,可观艺术" />
<meta name="Description" content="${ painting.title!''}鉴赏,大图,高清图片鉴赏" />
<link href="${ctx}/style/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${ctx}/js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="${ctx}/js/head.js"></script>
<style type="text/css">
	.main{ width:960px; margin:0 auto; text-align:center;margin-top: 5px;background: #ffffff;border: 1px solid #ccc;}
	.container{position:relative;}
	.preImg{position:absolute; left:-24px;top:150px; }
	.nextImg{position:absolute; right:-24px; top:150px;}
	.imgBox{ width:910px; overflow:hidden;margin:0 auto;padding-bottom: 10px; }
	
	#paintingDetailDiv{display:none;width:353px;height:179px;z-index:410;position:absolute;padding: 0px 15px 0px 15px;background: url("${ctx}/images/background_painterstar.png") no-repeat;}
	#paintingDetailDiv p{font-size: 12px;margin: 0;}
	
	#marketDetailDiv{display:none;width:353px;height:213px;z-index:420;position:absolute;background:#FFF;padding: 0px 15px 0px 15px;font-size: 12px;background: url("${ctx}/images/background_painting.png") no-repeat;}
	
	.imgList{ overflow:hidden; position:relative; width:960px; height:110px; background:#fff;margin:0 auto;display: none}
	.preBtn{ width:16px; height:90px;position:absolute; left:0px; padding-top:45px;background:#FFF;}
	.nextBtn{ width:16px; height:90px;position:absolute; right:0px;padding-top:45px;background:#FFF;}
	.imgsBox{height:92px; position:absolute; left:17px; top:0px; text-align:left;overflow:hidden;margin-top: 10px;}
	.cur_img_1{width: 76px;height: 90px;float:left;border:1px solid #ccc;cursor: pointer;margin-right:15px;}
	.cur_img{width: 76px;height: 90px;float:left;border:1px solid #ff9900;cursor: pointer;margin-right:15px;}
	.cur_img_1:hover{border:1px solid #ff9900;}

	/** painter begin ***/
	.painterList{ overflow:hidden; position:relative; width:960px; height:110px; margin:0 auto;background: #fff;border: 1px solid #ccc;margin-top: 5px;}
	.preBtn_painter{ width:25px; height:90px;position:absolute; left:0px; padding-top:45px;background: #ffffff;}
	.nextBtn_painter{ width:25px; height:90px;position:absolute; right:0px; padding-top:45px;background: #ffffff;text-align: right;}
	.imgsBox_painter{height:90px; position:absolute; left:35px; top:0px; text-align:left;overflow: hidden;margin-top: 10px;}
	.painter_outer{background-color:#cccccc;width: 76px;height: 90px;float:left;cursor: pointer;margin-right:15px;}
	.painter_outer_1{background-color:#ff9900;width: 76px;height: 90px;float:left;cursor: pointer;margin-right:15px;}
	.painter_outer:hover{background-color:#ff9900;}
	/** painter end ***/	
	
	.arrow_painter {font-family: "幼圆";font-size: 20px;text-transform: none;color: #b1b1b1;font-weight: bold;}
</style>

</head>

<body>

<#include "/commons/head2.ftl"/>

<!--begin main-->
<div class="main">
	<div style="padding: 15px 0px 15px 25px;text-align: center;">
		<span id="painting_title" style="font-size: 22px;font-family: 黑体;">《${ painting.title}》</span>
	</div>
		<div class="container">
			<div class="preImg"><img border="0" src="${ctx}/images/arrow_left.png"/></div>
			<div class="nextImg"><img border="0" src="${ctx}/images/arrow_right.png"/></div>
			<div class="imgBox"><img id="paintingImage" src="${painting.originalImagePath }" border="0" onmouseover="showDetail()" onmouseout="hiddenDetail()" /></div>
		</div>
	<div style="overflow:hidden;font-family: 宋体;font-size: 12px;color: #7c7c7c;padding-bottom: 10px;">作品图片来源于百度图片搜索</div>
</div>
<!--end main-->

<!-- begin painterList-->
	<div class="painterList">
		<div class="preBtn_painter"><img border="0" src="${ctx}/images/arrow_left.gif"/></div>
		<div class="imgsBox_painter"  id="painterImgsBoxDiv"></div>
		<div class="nextBtn_painter"><img border="0" src="${ctx}/images/arrow_right.gif"/></div>
	</div>
<!--end painterList-->
 
<div id="paintingDetailDiv" onmouseover="showSmallDiv();">
	<p style="text-align: right;cursor: pointer;padding: 13px 0 0 0" onclick="hiddenSmallDiv()"><img src="${ctx}/images/close.gif" width="16" height="16"/></p>
	<p style="text-align: center;padding-top: 10px;"><span id="title">${painting.painter.name}—《${painting.title}》</span></p>
	<p style="padding-top: 26px;text-align: center;">
		<img border="0" src="${ctx}/images/painterStarDetail.png" width="77" height="23" style="cursor: pointer" onclick="showPainterDetail();"/>
		<img border="0" src="${ctx}/images/painterStar_market.png" width="77" height="23" style="cursor: pointer;padding-left: 15px;" onclick="displayMarketDetailDiv('1')"/>
	</p>
	<p style="padding-left: 30px;padding-top: 26px;">作品分享：
		<a title="分享至新浪微博" onclick="javascript:window.open(_sina,'_blank');" href="javascript:void(0);"><img border="0" src="${ctx}/images/sina.jpg" width="25" height="23" style="cursor: pointer"/></a>
		<a title="分享至腾讯微博" onclick="javascript:window.open(_tencent,'_blank');" href="javascript:void(0);"><img border="0" src="${ctx}/images/tencent.jpg" width="25" height="23" style="cursor: pointer"/></a>
		<a title="分享至搜狐微博" onclick="javascript:window.open(_sohu,'_blank');" href="javascript:void(0);"><img border="0" src="${ctx}/images/sohu.jpg" width="25" height="23" style="cursor: pointer"/></a>
		<a title="分享至凤凰微博" onclick="javascript:window.open(_ifeng,'_blank');" href="javascript:void(0);"><img border="0" src="${ctx}/images/ifeng.jpg" width="25" height="23" style="cursor: pointer"/></a>
		<a title="分享至百度贴吧" onclick="javascript:window.open(_tieba,'_blank');" href="javascript:void(0);"><img border="0" src="${ctx}/images/tieba.jpg" width="71" height="23" style="cursor: pointer"/></a>
		<a title="分享至人人网" onclick="javascript:window.open(_renren,'_blank');" href="javascript:void(0);"><img border="0" src="${ctx}/images/renren.jpg" width="28" height="23" style="cursor: pointer"/></a>
		<input type="hidden" id="painting_id" value="${painting.id}"/>
		<input type="hidden" id="painter_id" value="${painting.painter.id}"/>
	</p>
</div>

<div id="marketDetailDiv">
	<div style="text-align: right;cursor: pointer;padding: 13px 0 0 0" onclick="displayMarketDetailDiv('0')"><img src="${ctx}/images/close.gif" width="16" height="16"/></div>
	<div style="float:left;clear: both;width: 353px;">
		<div style="float: left;width: 95px;padding-left: 10px;"><img src="" id="market_index_painter_image"/>
			<div id="market_index_painter" style="margin-top: 5px;padding-left: 15px;"></div>
		</div>
		<div style="float: left;">
			<ul style="margin: 0;padding: 0;list-style: none;">
				<li>最新行情</li>
				<li style="color: #FF6600;line-height: 25px;"><span id="newIndex"></span>元/平方尺</li>
				<li style="line-height: 22px;">历史最高</li>
				<li style="color: #FF6600;line-height: 25px;"><span id="maxIndex"></span>元/平方尺</li>
				<li style="line-height: 22px;">历史最低</li>
				<li style="color: #FF6600;line-height: 25px;"><span id="minIndex"></span>元/平方尺</li>
			</ul>
		</div>
	</div>
	<div style="width: 353px;float:left;text-align: center;line-height: 25px">数据来源：雅昌艺术市场监测中心</div>
</div>

<div id="browse_end_tip" style="position:absolute;z-index:10005;display:none;background: #000000;filter:alpha(opacity=60);opacity:0.60;width: 240px;height: 75px;top: 50%;left: 40%">
	<div style="text-align: right;cursor: pointer;" onclick="close_browse_end_tip()"><img src="${ctx}/images/close.gif" width="16" height="16"/></div>
	<div style="margin: 0 auto;margin-bottom: 20px;text-align: center;">
		<p style="color: #ffffff;font-size: 12px;">您已经浏览至该画家的最后一幅作品</p>
		<p style="margin-top: 5px;"><input type="button" value="浏览下一个画家作品" onclick="browseNextPainter()" style="cursor: pointer;"/></p>
	</div>
</div>

<div id="browse_first_tip" style="position:absolute;z-index:10005;display:none;background: #000000;filter:alpha(opacity=60);opacity:0.60;width: 240px;height: 75px;top: 50%;left: 40%">
	<div style="text-align: right;cursor: pointer;" onclick="close_browse_first_tip()"><img src="${ctx}/images/close.gif" width="16" height="16"/></div>
	<div style="margin: 0 auto; margin-bottom: 20px;text-align: center;">
		<p style="color: #ffffff;font-size: 12px;">您已经浏览至该画家的第一幅作品</p>
		<p style="margin-top: 5px;"><input type="button" value="浏览上一个画家作品" onclick="browsePrePainter()" style="cursor: pointer;"/></p>
	</div>
</div>

<#include "/commons/foot.ftl"/>


<script type="text/javascript">

var painters = ${ajaxData_painterList};
var _tencent = '';
var _sina ='';
var _sohu = '';
var _renren = '';
var _tieba = '';
var _ifeng = '';

var showDetailFlag = true;

/**初始化页面数据 begin  ***/
function init(){

	init_painter();
	
}
/**初始化页面数据 end  ***/

/**初始化 画家 列表  begin ****/
function init_painter(){
	
	var len = painters.length;

	var painterImgsBoxDiv = document.getElementById("painterImgsBoxDiv");
	var htmlStr = "";

	var current_painterId = '${painting.painter.id}';
 	for(var i= 0;i<len; i++){
 		 var imagepath = painters[i].smallImagePath;
		if( current_painterId == painters[i].id ){
			htmlStr += '<div class="painter_outer_1"><div style="margin-top:4px;margin-left:5px;width: 66px;height: 82px;background-position: center center;background-image: url('+imagepath+');"><a style="display:block;width:66px;height:82px;" title="'+painters[i].painter_name+'"></a></div></div>';
			if( i > 9 ){
				var left_amount = (i-5)*91;
				$(".preBtn_painter").css({"z-index":"600"});
				$(".nextBtn_painter").css({"z-index":"601"});
				$(".imgsBox_painter").animate({left:"-="+left_amount+"px"},300,"linear");
			}
			updateMarketIndexOfPainter(i);//更新市场行情指数
		}else{
			htmlStr += '<div class="painter_outer"><div style="margin-top:4px;margin-left:5px;width: 66px;height: 82px;background-position: center center;background-image: url('+imagepath+');"><a style="display:block;width:66px;height:82px;" title="'+painters[i].painter_name+'"></a></div></div>';
		}
	}

	if(len < 10){
		for(var i = len ;i<10;i++){
			htmlStr += '<div class="painter_outer"><div style="margin-top:4px;margin-left:5px;width: 66px;height: 82px;"></div></div>';
		}
	}
	
 	painterImgsBoxDiv.innerHTML = htmlStr ;
}
/**初始化 画家 列表  end ****/


/** 显示作品详情 **/
function showDetail(){

	if(showDetailFlag){
		
	 	var divId = document.getElementById("paintingDetailDiv");  
	 	divId.style.display = "block";

	 	/***屏幕绝对居中 begin ***/
	 	var myWidth = 0, myHeight = 0;
	 	if (typeof (window.innerWidth) == "number") {
	 	        myWidth = window.innerWidth;
	 	        myHeight = window.innerHeight;
	 	    } else {
	 	        if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
	 	            myWidth = document.documentElement.clientWidth;
	 	            myHeight = document.documentElement.clientHeight;
	 	        } else {
	 	            if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
	 	                myWidth = document.body.clientWidth;
	 	                myHeight = document.body.clientHeight;
	 	            }
	 	        }
	 	      }
	 	/***屏幕绝对居中 end ***/
	 	
	 	var v_left =(myWidth - divId.clientWidth) / 2+"px";
	 	var v_top =(myHeight - divId.clientHeight) / 2 + document.documentElement.scrollTop+"px";

	 	divId.style.left = v_left;
	 	divId.style.top = "50%";

	 	var imageWidth = $("#paintingImage").attr("width");
	 	if(divId.clientWidth >= imageWidth ){
			$("#paintingDetailDiv").live("mouseout",function(){
				document.getElementById('paintingDetailDiv').style.display="none";
			});
	 	}
	}
}

/*** 隐藏作品详情 *****/
function hiddenDetail(){
	document.getElementById('paintingDetailDiv').style.display="none";
	showDetailFlag = true;
}

/**鼠标在详情窗口上时隐藏浮层动作**/
function hiddenSmallDiv(){

	document.getElementById('paintingDetailDiv').style.display="none";
	showDetailFlag = false;
}

/**鼠标在详情窗口上时显示浮层动作**/
function showSmallDiv(){

	if(showDetailFlag){
	 	var divId = document.getElementById("paintingDetailDiv");  
	 	divId.style.display = "block";
	}
}

function init_weibo(title_painting,imagepath){
    var _t =  title_painting+"分享自 @可观艺术网";
    _t = encodeURIComponent(_t);
	var _source = 1000001;
	var _site = encodeURIComponent('http://www.keguan100.com');
	var _pic = imagepath;
    var _url = window.location.href;
    if(_url.indexOf('#') >0 ){
        _url = encodeURIComponent(_url.substr(0,_url.indexOf('#')));
    }else{
        _url = encodeURIComponent(_url);
    }
    
    _tencent = 'http://v.t.qq.com/share/share.php?appkey=&title='+_t+'&url='+_url+'&site='+_site+'&pic='+_pic;

	 _sina ='http://v.t.sina.com.cn/share/share.php?appkey=&url='+_url+'&title='+_t+'&source='+_source+'&sourceUrl='+_site+'&content=utf8'+'&pic='+_pic;

	 _sohu = 'http://t.sohu.com/third/post.jsp?content=utf-8&url='+_url+'&title='+_t+'&pic='+_pic;

	 _renren = 'http://share.renren.com/share/buttonshare.do?link='+_url+'&title='+_t;

	 _pic = encodeURIComponent(_pic);
	 _tieba = 'http://tieba.baidu.com/i/sys/share?title='+_t+'&type=picture&content='+_pic +'&link='+_url;
}


/** 画家详情  ***/
function showPainterDetail(){
	var painterId = $("#painter_id").val();
	location.href = "${ctx}/mj/mjxq_"+painterId+".html";
}

function createMask(){
	var maskDivHtml = '<div id="_link_div_win_mask" name="_link_div_win_mask" style="position:absolute;';
	maskDivHtml += 'filter:alpha(opacity=20);background-color:#000000;';
	maskDivHtml += 'top:0px;left:0px;width:100%;height:100%;z-index:10000;"></div>';
	var maskDiv = document.createElement("div");
	maskDiv.id = "_link_div_win_mask";
	maskDiv.name = "_link_div_win_mask";
	maskDiv.style.position = "absolute";
	maskDiv.style.filter = "alpha(opacity=20)";
	maskDiv.style.opacity = "0.2";
	maskDiv.style.backgroundColor = "#000000";
	maskDiv.style.top = "0px";
	maskDiv.style.left = "0px";
	maskDiv.style.width  = "100%";
	maskDiv.style.height  = "100%";
	maskDiv.style.zIndex  = "10000";
	
	var _scrollWidth = document.body.scrollWidth;
	var _scrollHeight = document.body.scrollHeight;
	var _clientWidth = document.body.clientWidth;
	var _clientHeight = document.body.clientHeight;
	maskDiv.style.width = _scrollWidth > _clientWidth ? _scrollWidth : _clientWidth;
	maskDiv.style.height = _scrollHeight > _clientHeight ? _scrollHeight : _clientHeight;
	document.body.appendChild(maskDiv);
	hideSelectBox();
}
function removeMask(){
	showSelectBox();
	document.body.removeChild(document.getElementById('_link_div_win_mask'));	
}
function hideSelectBox(){
	var selectBoxs = document.getElementsByTagName("select");
	for(var i=0;i<selectBoxs.length;i++){
		selectBoxs[i].style.visibility = 'hidden';
	}
}
function showSelectBox(){
	var selectBoxs = document.getElementsByTagName("select");
	for(var i=0;i<selectBoxs.length;i++){
		selectBoxs[i].style.visibility = 'visible';
	}
}

$(document).ready(function(){

		init(); //初始化图片列表
	
		var index_painter = $(".imgsBox_painter>div").index($(".painter_outer_1"));
   		$(".preImg").hover(function(){
   			$(this).css({cursor:"pointer",filter:"alpha(opacity=50)",opacity:"0.50"});
			},function(){
				$(this).css({cursor:"pointer",filter:"alpha(opacity=100)",opacity:"1.0"});
			}
		);	
		$(".nextImg").hover(function(){
			$(this).css({cursor:"pointer",filter:"alpha(opacity=50)",opacity:"0.50"});
			},function(){
				$(this).css({cursor:"pointer",filter:"alpha(opacity=100)",opacity:"1.0"});
			}
		);
		$(".preImg").click(function(){
					if("${preUrl}"!=""){
						location.href = "${ctx}/${preUrl}";
					}else{
						if(index_painter <= 0 ){
							alert("已经浏览至第一个艺术家了.");
							return false;
						}else{
							createMask();
							document.getElementById('browse_first_tip').style.display="block";
							return;
						}
					}
			});
		$(".nextImg").click(function(){
					if("${nextUrl}" != ""){
						location.href = "${ctx}/${nextUrl}";
					}else{
						var len = painters.length;
						if(index_painter >= len-1 ){
							alert("已经浏览至最后一个艺术家了.");
							return false;
						}else{
							createMask();
							document.getElementById('browse_end_tip').style.display="block";
							return;
						}
					}
		});
		function showImg(){
			$(".imgBox img").css({display:"none"});//先设置display为none，这样下面的渐变切换动画才会有效
			$(".imgBox img").fadeIn();	
		}

		//画家 列表   begin 
		$(".preBtn_painter").hover(function(){
			$(this).css({cursor:"pointer"});
			});
		$(".nextBtn_painter").hover(function(){
			$(this).css({cursor:"pointer"});
			});	
		$(".preBtn_painter").click(function(){
					setZindex_painter();				
					$(".imgsBox_painter").animate({left:"+=228px"},300,"linear",checkPos_painter);
		   });	
		$(".nextBtn_painter").click(function(){
					setZindex_painter();			
					$(".imgsBox_painter").animate({left:"-=228px"},300,"linear",checkPos_painter);//228px为两张图片的位置			
			});
		function checkPos_painter(){
			//alert("callBack");
			if(parseInt($(".imgsBox_painter").css("left"))>35){					
						$(".imgsBox_painter").animate({left:"35px"},300);
					}
			if(parseInt($(".imgsBox_painter").css("left"))<-(parseInt($(".imgsBox_painter").css("width"))-584)){					
					$(".imgsBox_painter").animate({left:-(parseInt($(".imgsBox_painter").css("width")))+584+"px"},300);			
			}	
		}
		$(".imgsBox_painter>div").click(function(){
					index_painter=$(".imgsBox_painter>div").index($(this));
					gotoOtherPainter(index_painter);
			});
		function setZindex_painter(){
			$(".preBtn_painter").css({"z-index":"600"});
			$(".nextBtn_painter").css({"z-index":"601"});
		}
		// 画家 列表end
		});


/********更新市场行情指数 begin ***********/
function updateMarketIndexOfPainter(index_painter){

	var imagepath = painters[index_painter].smallImagePath;

	$("#market_index_painter_image").attr("src",imagepath);
	$("#newIndex").html(painters[index_painter].newIndex);
	$("#maxIndex").html(painters[index_painter].maxIndex);
	$("#minIndex").html(painters[index_painter].minIndex);
	$("#market_index_painter").html(painters[index_painter].name);
}
/********更新市场行情指数 end ***********/

 function displayMarketDetailDiv(flag){
	 
	 var divId = document.getElementById("marketDetailDiv");  
	 
	if(flag=='1'){
	 	divId.style.display = "block";

	 	/***屏幕绝对居中 begin ***/
	 	var myWidth = 0, myHeight = 0;
	 	if (typeof (window.innerWidth) == "number") {
	 	        myWidth = window.innerWidth;
	 	        myHeight = window.innerHeight;
	 	    } else {
	 	        if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
	 	            myWidth = document.documentElement.clientWidth;
	 	            myHeight = document.documentElement.clientHeight;
	 	        } else {
	 	            if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
	 	                myWidth = document.body.clientWidth;
	 	                myHeight = document.body.clientHeight;
	 	            }
	 	        }
	 	      }
	 	/***屏幕绝对居中 end ***/
	 	
	 	var v_left =(myWidth - divId.clientWidth) / 2+"px";
	 	var v_top =(myHeight - divId.clientHeight) / 2 + document.documentElement.scrollTop+"px";

	 	divId.style.left = v_left;
	 	divId.style.top = "50%";
	}
	else if(flag=='0'){
	 	divId.style.display = "none";
	}
 }
 
 function gotoOtherPainter(index_painter){
 	var painting_id = painters[index_painter].first_painting;
 	location.href = "${ctx}/mj/mjzp_"+painting_id+".html";
 }

 function browseNextPainter(){

	   close_browse_end_tip();

	   var index_painter = $(".imgsBox_painter>div").index($(".painter_outer_1"));

		index_painter = index_painter + 1;

		var len = painters.length;
		if(index_painter > len ){
			return false;
		}
		
		gotoOtherPainter(index_painter);
 }

 function browsePrePainter(){

	 	close_browse_first_tip();
	 
	    var index_painter = $(".imgsBox_painter>div").index($(".painter_outer_1"));
	 
		index_painter = index_painter - 1;

		var len = painters.length;
		if(index_painter < 0 ){
			return false;
		}
		
	   gotoOtherPainter(index_painter);
 }

 function close_browse_end_tip(){

	 $("#browse_end_tip").hide();
	 hiddenSmallDiv();
	 removeMask();
 }

 function close_browse_first_tip(){
	 $("#browse_first_tip").hide();
	 hiddenSmallDiv();
	 removeMask();
 }
</script>
</body>
</html>
